<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text">
<input type="text">
<input type="button" value="加" onclick="fn1()">
<input type="button" value="减" onclick="fn2()">
<input type="button" value="乘" onclick="fn3()">
<input type="button" value="除" onclick="fn4()">
<h1>结果:<span></span></h1>

<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<script>
    function fn1() {
        //$("span").text(parseInt(($("input:first").val()))+parseInt(($("input:eq(1)").val())));
        let x = $("input:eq(0)").val();
        let y = $("input:eq(1)").val();
        $("span").text(x*1+y*1);
    }
    function fn2() {
        $("span").text(($("input:first").val())-($("input:eq(1)").val()));
    }
    function fn3() {
        $("span").text(($("input:first").val())*($("input:eq(1)").val()));
    }
    function fn4() {
        $("span").text(($("input:first").val())/($("input:eq(1)").val()));
    }
</script>
</body>
</html>